package com.cloud.pay.constant;

import lombok.Getter;

public enum TradeTypeEnum {

    QRCODE(1, "扫码支付"),
    JSAPI(2, "JSAPI支付"),
    APP(3,"应用内支付");

    @Getter
    private int code;

    @Getter
    private String description;

    TradeTypeEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static TradeTypeEnum of(int code) {
        for (TradeTypeEnum typeEnum : values()) {
            if (typeEnum.code == code) {
                return typeEnum;
            }
        }
        return null;
    }

}
